class Student:
    def __init__(self, name, gender, phone_number):
        self.name = name
        self.gender = gender
        self.phone_number = phone_number

    def __str__(self):
        return f"姓名: {self.name}, 性别: {self.gender}, 手机号: {self.phone_number}"


class StudentManagementSystem:
    def __init__(self):
        self.students = {}

    def add_student(self):
        """
        添加学生信息
        """
        name = input("请输入学生姓名: ")
        gender = input("请输入学生性别: ")
        phone_number = input("请输入学生手机号: ")
        self.students[name] = Student(name, gender, phone_number)
        print("学生信息添加成功。")

    def delete_student(self):
        """
        删除学生信息
        """
        name = input("请输入要删除的学生姓名: ")
        if name in self.students:
            del self.students[name]
            print("学生信息删除成功。")
        else:
            print("未找到该学生。")

    def modify_student(self):
        """
        修改学生信息
        """
        name = input("请输入要修改的学生姓名: ")
        if name in self.students:
            new_name = input("请输入新的学生姓名: ")
            new_gender = input("请输入新的学生性别: ")
            new_phone_number = input("请输入新的学生手机号: ")
            self.students[new_name] = Student(new_name, new_gender, new_phone_number)
            if name in self.students:
                del self.students[name]
            print("学生信息修改成功。")
        else:
            print("未找到该学生。")

    def display_students(self):
        """
        显示所有学生信息
        """
        if not self.students:
            print("没有学生信息。")
        else:
            for student in self.students.values():
                print(student)

    def run(self):
        """
        运行系统，提示用户选择操作
        """
        while True:
            print("\n学生信息管理系统")
            print("1. 添加学生信息")
            print("2. 删除学生信息")
            print("3. 修改学生信息")
            print("4. 显示所有学生信息")
            print("5. 退出系统")
            choice = input("请选择操作 (1-5): ")

            if choice == '1':
                self.add_student()
            elif choice == '2':
                self.delete_student()
            elif choice == '3':
                self.modify_student()
            elif choice == '4':
                self.display_students()
            elif choice == '5':
                print("退出系统。")
                break
            else:
                print("无效的选择，请重新输入。")


if __name__ == "__main__":
    sms = StudentManagementSystem()
    sms.run()